//
//  LoginFootView.m
//  NoneCar
//
//  Created by DongSen on 2018/7/13.
//  Copyright © 2018年 董森森. All rights reserved.
//

#import "LoginFootView.h"

@implementation LoginFootView
+ (LoginFootView*)loadView{
    NSArray * viewArray =[[NSBundle mainBundle] loadNibNamed:@"LoginFootView" owner:self options:nil];
    LoginFootView * view  = [viewArray firstObject];
    view.accountLogin = YES;
    view.loginButton.layer.masksToBounds = YES;
    view.loginButton.layer.cornerRadius = 4;
    view.loginButton.backgroundColor = STRCOLOR(@"#A6C1F6");
    return view;
}
- (IBAction)Changes:(UIButton *)sender{
    self.accountLogin =!self.accountLogin;
    self.block(self.accountLogin);
}
-(void)setCanCommit:(BOOL)canCommit{
    _canCommit = canCommit;
    if (_canCommit) {
        self.loginButton.backgroundColor = STRCOLOR(@"#3771E6");
    }
    else{
        self.loginButton.backgroundColor = STRCOLOR(@"#A6C1F6");
    }
}
-(void)setAccountLogin:(BOOL)accountLogin{
    self.canCommit = NO;
    _accountLogin = accountLogin;
    if (_accountLogin) {
        self.descripLabel.text = @"手机号登陆";
    }
    else{
        self.descripLabel.text = @"账号密码登陆";
    }
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
